package com.boot2551.mapper;

import com.boot2551.bean.Emp;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.io.IOException;
import java.util.List;

public interface EmpMapper {
    @Insert(value = "insert into emp(ename,epic,epic2,deptno,job,sal) values(#{ename},#{epic},#{epic2}," +
            "#{deptno},#{job},#{sal})")
    int insert(Emp e);
    List<Emp> all(String path) throws IOException;
    @Delete(value = "delete from emp where empno=#{id}")
    int delete(int id);
    @Select(value = "select * from emp e where empno=#{param1}")
    Emp one(int id,String path) throws IOException;
    @Update(value = "update emp set ename=#{ename},epic=#{epic},epic2=#{epic2}," +
            "deptno=#{deptno},job=#{job},sal=#{sal} where empno=#{empno}")
    int update(Emp e);
    int updateselective(Emp e);

}
